*Dataset is ReplicationDataTablesTruncated*
*Prvalue and Prchange commands rely on spost commands. Similar results can be obtained using margins*

**Creating Figure 1**
twoway (scatter fergperAug9to25 blackper if blackrep==1 & dem==1 & fergrep!=1 & blackper>0.149 & ///
blackper<. & otherrun!=1 & senaterun!=1) (scatter fergperAug9to25 blackper if blackrep!=1 & dem==1 & fergrep!=1 & blackper>0.149 & blackper<. & otherrun!=1 & senaterun!=1)

***Text Around Figure 1***
***Differences for black and non-black Dems in restricted sample of districts***
ttest fergperAug9to25 if blackper>0.149 & blackper<.500 & dem==1 & fergrep!=1, by(blackrep)
ttest fergperAug9to25 if blackper>0.149 & blackper<0.35 & dem==1 & fergrep!=1, by(blackrep)
**Tests excluding Emmanuel Cleaver. See footnotes #7 and 8***
ttest fergperAug9to25 if blackper>0.149 & blackper<.500 & dem==1 & fergrep!=1 & district!="MO-05", by(blackrep)
ttest fergperAug9to25 if blackper>0.149 & blackper<0.35 & dem==1 & fergrep!=1 & district!="MO-05", by(blackrep)


***Correlations reported in text near Figure 1***
cor fergperAug9to25 blackper if dem==1 & fergrep!=1
cor fergperAug9to25 blackper if dem==0 & fergrep!=1
cor fergperAug9to25 blackper if dem==1 & blackrep==1 & fergrep!=1
cor fergperAug9to25 blackper if dem==1 & blackrep==0 & fergrep!=1
**This Excludes Steve Cohen**
cor fergperAug9to25 blackper if dem==1 & blackrep==0 & district!="TN-09" & fergrep!=1 


**Table 2 Model**
nbreg ferggarnerAug9to25 blackrep hisprep asianrep dem obamaper blackper house retire unrelatedtweetsAug9to25 if fergrep!=1 & otherrun!=1 & senaterun!=1
prchange unrelatedtweetsAug9to25, x(blackrep=0 hisprep=0 asianrep=0 dem=1  obamaper=63 blackper=0.154  house=1 retire=0 unrelatedtweetsAug9=27 )
prchange blackrep, x( hisprep=0 asianrep=0 dem=1 obamaper=63 blackper=0.154  house=1 retire=0 unrelatedtweetsAug9=27)
prchange obamaper, x(blackrep=0 hisprep=0 asianrep=0 dem=1  blackper=0.154  house=1 retire=0 unrelatedtweetsAug9=27)

***Predicted Changes from Table 2  Described in Text***
nbreg ferggarnerAug9to25 blackrep hisprep asianrep dem obamaper blackper house retire unrelatedtweetsAug9to25 if fergrep!=1 & otherrun!=1 & senaterun!=1
prvalue, x(blackrep=0 hisprep=0 asianrep=0 dem=1 obamaper=63 blackper=0.25  house=1 retire=0 unrelatedtweetsAug9=27) save
prvalue, x(blackrep=1 hisprep=0 asianrep=0 dem=1 obamaper=63 blackper=0.25  house=1 retire=0 unrelatedtweetsAug9=27) diff level(95)
prvalue, x(blackrep=0 hisprep=0 asianrep=0 dem=1 obamaper=55 blackper=0.154  house=1 retire=0 unrelatedtweetsAug9=27) save
prvalue, x(blackrep=0 hisprep=0 asianrep=0 dem=1 obamaper=70 blackper=0.154  house=1 retire=0 unrelatedtweetsAug9=27) diff level(95)


**Model with members running for other offices included, see footnote 11**
nbreg ferggarnerAug9to25 blackrep hisprep asianrep dem obamaper blackper house retire unrelatedtweetsAug9to25 if fergrep!=1

**Model with Ferg. Rep dummy variable included, see footnote 11**
nbreg ferggarnerAug9to25 blackrep hisprep asianrep dem obamaper blackper house retire fergrep unrelatedtweetsAug9to25

**Zero-Inflated Model, see footnote 12**
zinb ferggarnerAug9to25 blackrep hisprep asianrep dem obamaper blackper house retire unrelatedtweetsAug9to25 if fergrep!=1 & otherrun!=1 & senaterun!=1, inflate(blackrep hisprep asianrep dem obamaper blackper house retire unrelatedtweetsAug9to25)
prchange blackrep, x(hisprep=0 asianrep=0 dem=1  obamaper=63 blackper=0.154  house=1 retire=0 unrelatedtweetsAug9=27)


**Table 3 Model**
nbreg FergGarnerGJrelevant blackrep hisprep asianrep dem obamaper blackper house FergGarnerGJnonrelevant if fergrep!=1 & nycrep!=1 & otherrun!=1 & senaterun!=1 & retire!=1
prchange blackrep, x(hisprep=0 asianrep=0 dem=1  obamaper=63 blackper=0.154  house=1 FergGarnerGJnonrelevant=3.38)
prchange hisprep, x(blackrep=0 asianrep=0 dem=1  obamaper=63 blackper=0.154  house=1 FergGarnerGJnonrelevant=3.38)
prchange dem, x(blackrep=0 hisprep=0 asianrep=0 obamaper=63 blackper=0.154  house=1 FergGarnerGJnonrelevant=3.38)
prchange house, x(blackrep=0 hisprep=0 asianrep=0 dem=1 obamaper=63 blackper=0.154 FergGarnerGJnonrelevant=3.38)
prchange FergGarnerGJnonrelevant, x(blackrep=0 hisprep=0 asianrep=0 dem=1 obamaper=63 blackper=0.154 house=1)

***Predicted Changes from Table 3 Described in Text***

prvalue, x(blackrep=0 hisprep=0 asianrep=0 dem=1  obamaper=63 blackper=0.25 house=1 FergGarnerGJnonrelevant=3.38 ) save
prvalue, x(blackrep=1 hisprep=0 asianrep=0 dem=1  obamaper=63 blackper=0.25 house=1 FergGarnerGJnonrelevant=3.38 ) diff level(99)
prvalue, x(blackrep=0 hisprep=0 asianrep=0 dem=0  obamaper=50 blackper=0.154 house=1 FergGarnerGJnonrelevant=3.38 ) save
prvalue, x(blackrep=0 hisprep=0 asianrep=0 dem=1  obamaper=50 blackper=0.154 house=1 FergGarnerGJnonrelevant=3.38 ) diff level(95)

**Model with all members and Ferguson and NYC dummy variables, see footnote 14**
nbreg FergGarnerGJrelevant blackrep hisprep asianrep dem obamaper blackper house FergGarnerGJnonrelevant fergrep nycrep


